﻿Public Class frmMain
    Public debug As New frmDebug()
    WithEvents frm As New Form()
    Dim close As Boolean = True


    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        debug.Show()
    End Sub

    Private Sub frmClosed(sender As System.Object, e As System.Windows.Forms.FormClosedEventArgs) Handles frm.FormClosed
        close = True
    End Sub

#Region "Comportamiento"

    Private Sub btnCommand_Click(sender As System.Object, e As System.EventArgs) Handles btnCommand.Click
        If close Then
            close = False
            frm = New frmCommand()
            frm.Show()
        End If
    End Sub

    Private Sub btnStrategy_Click(sender As System.Object, e As System.EventArgs) Handles btnStrategy.Click
        If close Then
            close = False
            frm = New frmStrategy()
            frm.Show()
        End If
    End Sub

    Private Sub btnTemplateMethod_Click(sender As System.Object, e As System.EventArgs) Handles btnTemplateMethod.Click
        If close Then
            close = False
            frm = New frmTemplateMethod()
            frm.Show()
        End If
    End Sub

    Private Sub btnObserver_Click(sender As System.Object, e As System.EventArgs) Handles btnObserver.Click
        If close Then
            close = False
            frm = New frmObserver()
            frm.Show()
        End If
    End Sub

    Private Sub btnIterator_Click(sender As System.Object, e As System.EventArgs) Handles btnIterator.Click
        If close Then
            close = False
            frm = New frmIterator()
            frm.Show()
        End If
    End Sub

    Private Sub btnMemento_Click(sender As System.Object, e As System.EventArgs) Handles btnMemento.Click
        If close Then
            close = False
            frm = New frmMemento()
            frm.Show()
        End If
    End Sub

    Private Sub btnChainofResponsibility_Click(sender As System.Object, e As System.EventArgs) Handles btnChainofResponsibility.Click
        If close Then
            close = False
            frm = New ChainofResponsibility()
            frm.Show()
        End If
    End Sub

#End Region

#Region "Creacionales"

    Private Sub btnFactory_Click(sender As System.Object, e As System.EventArgs) Handles btnFactory.Click
        If close Then
            close = False
            frm = New frmFactoryMethod()
            frm.Show()
        End If
    End Sub

    Private Sub btnAbstractFactory_Click(sender As System.Object, e As System.EventArgs) Handles btnAbstractFactory.Click
        If close Then
            close = False
            frm = New frmAbstractFactory()
            frm.Show()
        End If
    End Sub

    Private Sub btnSingleton_Click(sender As System.Object, e As System.EventArgs) Handles btnSingleton.Click
        If close Then
            close = False
            frm = New frmSingleton()
            frm.Show()
        End If
    End Sub

    Private Sub btnBuilder_Click(sender As System.Object, e As System.EventArgs) Handles btnBuilder.Click
        If close Then
            close = False
            frm = New frmBuilder()
            frm.Show()
        End If
    End Sub

    Private Sub btnPrototype_Click(sender As System.Object, e As System.EventArgs) Handles btnPrototype.Click
        If close Then
            close = False
            frm = New frmPrototype()
            frm.Show()
        End If
    End Sub

#End Region


End Class
